package com.ks.comment.controller;


import com.ks.comment.controller.dto.CommentListRequest;
import com.ks.comment.service.IZpzShareService;
import com.ks.core.base._ControllerBase;
import com.ks.core.core.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


import java.util.Map;

/**
 * <p>
 * 信息转发日志表 前端控制器
 * </p>
 *
 * @author kingdee123
 * @since 2020-12-18
 */
@RestController
@RequestMapping("/zpzShare")
@Api(value = "转发登记日志表", description = "转发登记日志表")
public class ZpzShareController extends _ControllerBase {

    @Autowired
    private IZpzShareService zpzShareService;

    @GetMapping("/addShare")
    @ApiOperation(value = "转发日志等级表添加", notes = "转发日志等级表添加")
    public Object addShare(@RequestParam int informationId, @RequestParam String type, @RequestParam String forwardName) {
        int i = zpzShareService.addShare(this.GetAuthorToken(), informationId, type, forwardName);
        return Result.success(i);
    }

    @PostMapping("/getShareList")
    @ApiOperation(value = "请求信息的转发日志记录清单", notes = "请求信息的转发日志记录清单")
    public Object addJournal(@RequestBody CommentListRequest request) {
        Map<String, Object> shareList = zpzShareService.getShareList(request.getInFormationId(), request.getType(), request.getPageNo(), request.getPageSize());
        return Result.success(shareList);
    }

}

